function! Checkpython()
 if &filetype!="python"
  echohl WarningMsg | echo "Fail to check syntax! Please select the right file!" | echohl None
  return
 endif
 if &filetype=="python"
  setlocal makeprg=c:\Python31\python.exe
  setlocal shellpipe=>
  setlocal errorformat=File\ %f,\ line\ %l
 endif
 execute "silent make %"
 execute "normal :"
 execute "copen"
endfunction
map <F4> :call Checkpython()<CR>
"}}}

